package components;

import common.Constant;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class SharePreferencesManager {

	private final static String DONT_SHOW_AGAIN_KEY = "dont_show_again";
	private static void setDontShowAgain (Context context, boolean isDontShow) {
		SharedPreferences spref = context.getSharedPreferences(
				Constant.KEY_SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE);
		Editor edit = spref.edit();
		edit.putBoolean(DONT_SHOW_AGAIN_KEY , isDontShow);
		edit.commit();
	}
	
	public static void dontShowPowerConfirm(Context context) {
		setDontShowAgain(context, true);
	}
	
	public static boolean getDontShowAgain(Context context) {
		SharedPreferences spref = context.getSharedPreferences(
				Constant.KEY_SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE);
		return spref.getBoolean(DONT_SHOW_AGAIN_KEY, false);
		
	}
}
